//
//  BaseContentCell.m
//  ZYHome
//
//  Created by Teplot_03 on 16/7/7.
//  Copyright © 2016年 Teplot_01. All rights reserved.
//

#import "BaseContentCell.h"

@interface BaseContentCell ()



@end

@implementation BaseContentCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self setup];
    }
    return self;
}

- (void)setup {
    [self.contentView addSubview:self.deleteBtn];
    
    //约束
    _deleteBtn.sd_layout.leftSpaceToView(self.contentView,0)
    .widthIs(40)
    .topEqualToView(self.contentView)
    .heightRatioToView(self.contentView,1);
    
}

#pragma mark - lazy load
/**
 *  topBtn
 deleteBtn
 textL
 */

- (UIButton *)deleteBtn {
    if (!_deleteBtn) {
        _deleteBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [_deleteBtn setImage:[UIImage imageNamed:@"XXX"] forState:UIControlStateNormal];
        [_deleteBtn addTarget:self action:@selector(deleteBtnClick) forControlEvents:UIControlEventTouchUpInside];
    }
    return _deleteBtn;
}

- (void)deleteBtnClick {
    if ([self.delegate respondsToSelector:@selector(baseContentCell:deleteBtnClick:)]) {
        [self.delegate baseContentCell:self deleteBtnClick:_deleteBtn];
    }
}

@end
